//
//  ZYSalaryTool.m
//  DesignMode
//
//  Created by wangzhipan on 2024/9/9.
//

#import "ZYSalaryTool.h"

@interface ZYSalaryTool() {
    double _salaryBase;
}

@property (nonatomic, assign) ZYSalarlCountry country;

@end

@implementation ZYSalaryTool
- (instancetype)initWithCountry:(ZYSalarlCountry)country
{
    if (self = [super init]) {
        _salaryBase = 10000;
        self.country = country;
    }
    return self;
}


//这里要写很多if，每次汇率变化都要更改
//如果工作还涉及专利费用、报销费用、不同的税后计算方式等等，这个函数就会很膨大
- (double)calculateSalarl
{
    double result = 0;
    
    if (_country == ZYSalarlCountryCN) {
        result = _salaryBase * 1.0f;
    }
    else if (_country == ZYSalarlCountryUS) {
        result = _salaryBase * 7.0f;
    }
    else if (_country == ZYSalarlCountryDE) {
        result = _salaryBase * 6.3f;
    }
    else if (_country == ZYSalarlCountryFR) {
        result = _salaryBase * 5.2f;
    }
    return result;
}
@end
